package TeatCase;

import android.support.test.runner.AndroidJUnit4;
import android.util.Log;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.util.List;

import QunarTest.QuanrTestCase;

import static HomeElements.Action.*;
import static HomeElements.AssertElementsContent.*;
import static org.junit.Assert.*;
/**
 * Created by zhe.xiao on 2017/6/29.
 */

public class TestXiaoGuangGao extends QuanrTestCase{

    /**
     * 测试6+1第一个广告
     */
    @Test
    public void testGuangGao1(){
        swipeGuangGao();
        List<String> l = guangGao1Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao1title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao1subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao1();
        String td = guangGao1Des1();
        assertEquals(td, "特价推荐");
    }

    /**
     * 测试6+1第二个广告
     */
    @Test
    public void testGuangGao2(){
        swipeGuangGao();
        List<String> l = guangGao2Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao2title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao2subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao2();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第三个广告
     */
    @Test
    public void testGuangGao3(){
        swipeGuangGao();
        List<String> l = guangGao3Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao3title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao3subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao3();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第四个广告
     */
    @Test
    public void testGuangGao4(){
        swipeGuangGao();
        List<String> l = guangGao4Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao4title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao4subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao4();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第五个广告
     */
    @Test
    public void testGuangGao5(){
        swipeGuangGao();
        List<String> l = guangGao5Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao5title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao5subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao5();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第六个广告
     */
    @Test
    public void testGuangGao6(){
        swipeGuangGao();
        List<String> l = guangGao6Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao6title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao6subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao6();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第七个广告
     */
    @Test
    public void testGuangGao7(){
        swipeGuangGao();
        List<String> l = guangGao7Des();
        String title = l.get(0);
        String sub_title = l.get(1);
        Log.v("UIAUTOMATOR", "testGuangGao7title: " + title);
        Log.v("UIAUTOMATOR", "testGuangGao7subtitle: " + sub_title);
        assertFalse(title.isEmpty());
        assertFalse(sub_title.isEmpty());
        clickGuangGao7();
        assertTrue(guangGaoTongDes());
    }

    /**
     * 测试6+1第八个广告
     */
    @Test
    public void testGuangGao8(){
        swipeGuangGao();
        String title = guangGao8Des();
        Log.v("UIAUTOMATOR", "testGuangGao8title: " + title);
        assertFalse(title.isEmpty());
        clickGuangGao8();
        assertTrue(guangGaoTongDes());
    }
}
